'use strict';

const Controller = require('egg').Controller;

class DetailsController extends Controller {
  async getHouseDetail() {
    const createRule = {
<<<<<<< HEAD
        detailId: {
=======
        houseId: {
>>>>>>> 732deab553a83bd23ce5ab1d416e1b615a719bfb
            type: "string",
        }
    }
    try{
        this.ctx.validate(createRule,this.ctx.query)
<<<<<<< HEAD
        const detail = await this.ctx.service.getDetail.getHouseDetail(this.ctx.query.detailId)

        this.ctx.body = {
            code:200,
            data:detail[0]
=======
        const detail = await this.ctx.service.getDetail.getHouseDetail(this.ctx.query.houseId)

        this.ctx.body = {
            code:200,
            data:detail
>>>>>>> 732deab553a83bd23ce5ab1d416e1b615a719bfb
        }
    }catch(err){
        this.ctx.body = {
            code:404,
            data:"参数有误"
        }
    }
  }
}

module.exports = DetailsController;
